package com.hui.entity.dao;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;
import java.math.BigDecimal;

/**
 * 商品表(StoreProduct)表实体类
 *
 * @author hui
 * @since 2022-07-12 23:08:11
 */
@SuppressWarnings("serial")
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("store_product")
public class StoreProduct extends BaseDomain {
    @TableId
    @ApiModelProperty("商品ID")
    private Long id;
    @ApiModelProperty("商户Id(0为总后台管理员创建,不为0的时候是商户后台创建) 预留字段")
    private Integer merId;
    @NotBlank(
            message = "请上传商品图片"
    )
    @ApiModelProperty("商品图片")
    private String image;
    @NotBlank(
            message = "请上传商品轮播图"
    )
    @ApiModelProperty("商品轮播图")
    private String sliderImage;
    @NotBlank(
            message = "商品名称不能空"
    )
    @ApiModelProperty("商品名称")
    private String storeName;
    @ApiModelProperty("商品简介")
    private String storeInfo;
    @ApiModelProperty("关键字")
    private String keyword;
    @ApiModelProperty("产品条码（一维码）")
    private String barCode;
    @ApiModelProperty("分类id")
    private String cateId;
    @ApiModelProperty("商品价格")
    @NotNull(
            message = "请输入商品价格"
    )
    @DecimalMin(
            value = "0.00",
            message = "商品价格不在合法范围内"
    )
    @DecimalMax(
            value = "99999999.99",
            message = "商品价格不在合法范围内"
    )
    private BigDecimal price;
    @ApiModelProperty("会员价格")
    private BigDecimal vipPrice;
    @ApiModelProperty("市场价")
    @NotNull(
            message = "请输入市场价"
    )
    @DecimalMin(
            value = "0.00",
            message = "市场价不在合法范围内"
    )
    @DecimalMax(
            value = "99999999.99",
            message = "市场价不在合法范围内"
    )
    private BigDecimal otPrice;
    @ApiModelProperty("邮费")
    private BigDecimal postage;
    @NotBlank(
            message = "请填写单位"
    )
    @ApiModelProperty("单位名")
    private String unitName;
    @ApiModelProperty("排序")
    private Integer sort;
    @ApiModelProperty("销量")
    private Integer sales;
    @ApiModelProperty("库存")
    @NotNull(
            message = "请输入库存"
    )
    @Min(
            message = "库存不能小于0",
            value = 1L
    )
    private Integer stock;
    @ApiModelProperty("需要多少积分兑换 只在开启积分兑换时生效")
    private Integer integral;
    @ApiModelProperty("状态（0：未上架，1：上架）")
    private Integer isShow;
    @ApiModelProperty("是否热卖（0：否，1：是）")
    private Integer isHot;
    @ApiModelProperty("是否猜你喜欢（0：否，1：是）")
    private Integer isBenefit;
    @ApiModelProperty("是否精品（0：否，1：是）")
    private Integer isBest;
    @ApiModelProperty("是否新品（0：否，1：是）")
    private Integer isNew;
    @NotBlank(
            message = "请填写商品详情"
    )
    @ApiModelProperty("商品详情")
    private String description;
    @ApiModelProperty("是否包邮")
    private Integer isPostage;
    @ApiModelProperty("商户是否代理 0不可代理1可代理 ")
    private Integer merUse;
    @ApiModelProperty("获得积分")
    @DecimalMin(
            value = "0.00",
            message = "获得积分不在合法范围内"
    )
    @DecimalMax(
            value = "99999999.99",
            message = "获得积分不在合法范围内"
    )
    private BigDecimal giveIntegral;
    @ApiModelProperty("成本价")
    @NotNull(
            message = "请输入成本价"
    )
    @DecimalMin(
            value = "0.00",
            message = "成本价不在合法范围内"
    )
    @DecimalMax(
            value = "99999999.99",
            message = "成本价不在合法范围内"
    )
    private BigDecimal cost;
    @ApiModelProperty("秒杀状态 0 未开启 1已开启")
    private Integer isSeckill;
    @ApiModelProperty("砍价状态 0 未开启 1已开启")
    private Integer isBargain;
    @ApiModelProperty("是否优品推荐（0：否，1：是）")
    private Integer isGood;
    @ApiModelProperty("虚拟销量")
    private Integer ficti;
    @ApiModelProperty("浏览量")
    private Integer browse;
    @ApiModelProperty("品二维码地址(用户小程序海报) ")
    private String codePath;
    @ApiModelProperty("邮费模版ID")
    private Integer tempId;
    @ApiModelProperty("规格 0单 1多 ")
    private Integer specType;
    @ApiModelProperty("是否单独分佣")
    private Integer isSub;
    @ApiModelProperty("是否开启积分兑换")
    private Integer isIntegral;
    @TableField(
            exist = false
    )
    private StoreCategory storeCategory;

}

